package com.songlanyun.modules.chain.controller.admin;

import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;
import com.songlanyun.modules.chain.model.vo.ChainVO;
import com.songlanyun.modules.chain.service.ChainService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 后端控制台 查询积分提现及审核提现
 * @author zhangqh
 */
@RestController
@RequestMapping("admin/chain/")
public class ChainAdminController extends AbstractController {
    @Resource
    ChainService chainService;

    @GetMapping("/list")
    public R list(@RequestParam Map<String, Object> params) {
        PageUtils page = chainService.queryPage(params);
        return R.ok().put("page", page);
    }

    @PostMapping("/audit")
    public R audit(@RequestBody ChainVO chainVO) {
        chainService.audit(chainVO);
        return R.ok();
    }
}
